<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function showMe() {
            <%
              out.print("alert('你好，我是老刘');");
            %>
        }
    </script>
</head>
<body>
<h1>演示按钮</h1>
<input type="button" value="点击" onclick="showMe()"/>
<%
    String[] ar = {"dog", "cat", "pig", "cow", "goat", "sheep"};
    for (int i = 0; i < ar.length; i++) {
        out.print("<h2>" + ar[i] + "</h2>");
    }
    out.print("<hr/>");
    for (int i = 0; i < ar.length; i++) {
    %>
        <h1><%=ar[i]%></h1>
<%}%>
</body>
</html>
